package de.koller.planet2D.frame.listener;

import de.koller.planet2D.PNode;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;

public class ChangeListener implements DocumentListener {

	private final PNode node;

	public ChangeListener( PNode node ) {
		this.node = node;
	}
	
	@Override
	public void changedUpdate( DocumentEvent e ) {
		notifyForChange();
	}

	@Override
	public void insertUpdate( DocumentEvent e ) {
		notifyForChange();
	}

	@Override
	public void removeUpdate( DocumentEvent e ) {
		notifyForChange();
	}
	
	private void notifyForChange() {
		node.proot.updateThis();
	}
	
}
